<template>
	<scroll-view class="myPicPrev" scroll-x scroll-y v-show="!item.common.isHidden" :style="commonStyle">
		<image :src="item.common.src" :style="bgPicStyle"></image>
	</scroll-view>
</template>

<script>
	import calcBaseStyle from '../libs/calcBaseStyle'
	export default {
		name: 'myPicPrev',
		props:{
			pageConfig: {
				type: Object,
				default(){
					return {}
				}
			},
			pcid: null
		},
		data(){
			return {
				item: {common: {},style: {},children:[]},
			}
		},
		created() {
			this.$parent.widgetList.some(widget=>{
				if(widget.cid === this.pcid){
					this.item = widget
					return true
				}
			})
		},
		computed:{
			commonStyle(){
				return calcBaseStyle(this.item,this.pageConfig.contentH)
			},
			bgPicStyle(){
				var item = this.item
				return 'width:'+item.common.ow+'px;height:'+item.common.ow+'px;'
			}
		}
	}
</script>

<style lang="less" scoped>
	.myPicPrev{
		position: absolute;
		overflow: hidden;
	}
</style>
